Index Property (AddressList Object) 

The Index property returns the index number for this AddressList object within the AddressLists collection. Read-only.

Syntax

objAddressList.Index

Data Type

Long

Remarks

The Index property indicates this object s position within the parent AddressLists Collection3OA6JWC.

Example

Function AddressListsGetByIndex()

Dim rqIndex As Long ' requested index value within collection

Dim svIndex As Long ' saved index value within collection

Dim objOneAddressList As Object

    ' set error handler here

    If objAddressListsColl Is Nothing Then

        MsgBox "must select a valid AddressLists collection"

        Exit Function

    End If

    If 0 = objAddressListsColl.Count Then

        MsgBox "must select collection with 1 or more address lists"

        Exit Function

    End If

    ' prompt user for rqIndex

    Set objOneAddressList = objAddressListsColl.Item(rqIndex)

    MsgBox "Selected address list: " & objOneAddressList.Name

    svIndex = objOneAddressList.Index ' save index for later

    ' get same AddressList object later

    Set objOneAddressList = objAddressListsColl.Item(svIndex)

    If objOneAddressList Is Nothing Then

        MsgBox "Error: could not reselect the address list"

    Else

        MsgBox "Reselected address list (" & svIndex & _

            ") using saved index: " & objOneAddressList.Name

    End If

    Exit Function